package de.gwtprime.shared.requestFactory.request;

import java.util.List;

import com.google.web.bindery.requestfactory.shared.InstanceRequest;
import com.google.web.bindery.requestfactory.shared.Request;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import com.google.web.bindery.requestfactory.shared.Service;

import de.gwtprime.server.model.Article;
import de.gwtprime.server.model.MyServiceLocator;
import de.gwtprime.shared.requestFactory.ArticleCommentProxy;
import de.gwtprime.shared.requestFactory.ArticleProxy;
import de.gwtprime.shared.requestFactory.ArticleSectionProxy;
import de.gwtprime.shared.requestFactory.User2Proxy;
import de.gwtprime.shared.requestFactory.VoteProxy;
import de.gwtprime.shared.requestFactory.VoteSectionCompletedProxy;

@Service(value = Article.class, locator = MyServiceLocator.class)
public interface ArticleRequest extends RequestContext {

	Request<List<ArticleProxy>> loadLatestArticles(int numberArticles);

	Request<ArticleProxy> findArticle(Long id);
	
	InstanceRequest<ArticleProxy, Long> persist();

	InstanceRequest<ArticleProxy, Void> remove();
	
	InstanceRequest<ArticleProxy, Void> addSectionAndPersist(ArticleSectionProxy section);
	
	InstanceRequest<ArticleProxy, Void> addCommentAndPersist(ArticleCommentProxy section);
	
	InstanceRequest<ArticleProxy, Void> addCommentAndPersist(ArticleCommentProxy section, User2Proxy user);
	
	InstanceRequest<ArticleProxy, List<VoteProxy>> getAllSectionVotesForUser(User2Proxy user);
	
	InstanceRequest<ArticleProxy, List<VoteSectionCompletedProxy>> getAllSectionVotesCompleteForUser(User2Proxy user);
	
}
